﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model RealtReview.DataAccess.SearchParameters.ReviewSearchParameters
<div class="row">
    <div class="col-sm-3 col-md-3">
        <div class="panel panel-default">
            <div class="panel-heading">Параметры поиска</div>
            <div class="panel-body">
                @using (Html.BeginForm())
                {
                    <div class="form-group">
                        @Html.LabelFor(model => model.City, htmlAttributes: new { @class = "control-label col-md-2" })
                        @Html.DropDownListFor(x => x.City, new List<SelectListItem>(), htmlAttributes: new { @class = "form-control" })
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(model => model.ApartmentType, new { @class = "control-label col-md-2" })
                        @Html.EditorFor(model => model.ApartmentType, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.ApartmentType, "", new { @class = "text-danger" })
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(model => model.RentType, new { @class = "control-label col-md-2" })
                        @Html.EditorFor(model => model.RentType, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.RentType, "", new { @class = "text-danger" })
                    </div>
                    <div class="form-group">
                        @Html.LabelFor(model => model.RoomsCount, htmlAttributes: new { @class = "control-label col-md-2" })
                        @Html.EditorFor(model => model.RoomsCount, new { htmlAttributes = new { @class = "form-control" } })
                        @Html.ValidationMessageFor(model => model.RoomsCount, "", new { @class = "text-danger" })
                    </div>

                    <div class="form-group text-center">
                        <button class="btn btn-primary" id="findButton">Найти</button>
                    </div>
                }
            </div>
        </div>
    </div>
    <div class="col-sm-9 col-md-9">
        <div class="row">
            <div id="content">
                <ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
                    <li class="active"><a href="#tabmap" data-toggle="tab"><span class="glyphicon glyphicon-map-marker"></span>Карта</a></li>
                    <li><a href="#tablist" data-toggle="tab"><span class="glyphicon glyphicon-list"></span>Список</a></li>
                </ul>
                <div id="my-tab-content" class="tab-content">
                    <div class="tab-pane active" id="tabmap">
                        <div id="map" style="height: 600px;"></div>
                    </div>
                    <div class="tab-pane" id="tablist">
                        <div id="reviewList">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row-md-11">
                <div class="ad">
                    <a href="http://www.jquery2dotnet.com" class="title">jQuery2DotNet</a>
                    <div>
                        Cool jQuery, CSS3, HTML5, Bootstrap, and MVC tutorial
                    </div>
                    <a href="http://www.jquery2dotnet.com" class="url">www.jquery2dotnet.com</a>
                </div>
            </div>
        </div>
    </div>
</div>
@section scripts {
    <script src="@Url.Content("~/Scripts/geocoder.js")"></script>
    <script src="@Url.Content("~/libs/mustache.js")"></script>
    <script src="@Url.Content("~/Scripts/review-read-page.js")"></script>

    <script type="text/javascript">
        if (typeof Resources == 'undefined') {
            var Resources = {};
            window.Resources = Resources;
        }
        var searchReview = {
            cities: '@Url.Action("cities", "api/data")',
            find: '@Url.Action("SearchReviews", "Review")',
        }
        Resources.searchReview = searchReview;
    </script>

    <script id="template" type="x-tmpl-mustache">
        <div class="row">
            <div class="pull-right">
                <span class="text-muted"><b>1</b>–<b>50</b> of <b>277</b></span>
                <div class="btn-group btn-group-sm">
                    <button type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-chevron-left"></span>
                    </button>
                    <button type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-chevron-right"></span>
                    </button>
                </div>
            </div>
        </div>
        {{#RootTag}}
        <div class="well">
            <div class="media">
                <a class="pull-left" href="#">
                    <img class="media-object" src="http://placekitten.com/150/150">
                </a>
                <div class="media-body">
                    <a href="/Review/Details?reviewId={{Id}}">Отзыв</a>
                    <p class="text-right">By Francisco</p>
                    <p>{{Latitude}} {{Longitude}} {{Price}} {{Description}}</p>
                    <ul class="list-inline list-unstyled">
                        <li><span><i class="glyphicon glyphicon-calendar"></i> 2 days, 8 hours </span></li>
                        <li>|</li>
                        <span><i class="glyphicon glyphicon-comment"></i> 2 comments</span>
                        <li>|</li>
                        <li>
                            <span class="glyphicon glyphicon-star"></span>
                            <span class="glyphicon glyphicon-star"></span>
                            <span class="glyphicon glyphicon-star"></span>
                            <span class="glyphicon glyphicon-star"></span>
                            <span class="glyphicon glyphicon-star-empty"></span>
                        </li>
                        <li>|</li>
                        <li>
                            <!-- Use Font Awesome http://fortawesome.github.io/Font-Awesome/ -->
                            <span><i class="fa fa-facebook-square"></i></span>
                            <span><i class="fa fa-twitter-square"></i></span>
                            <span><i class="fa fa-google-plus-square"></i></span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        {{/RootTag}}
        {{^RootTag}}
        Нет отзывов
        {{/RootTag}}
        <div class="row">
            <div class="pull-right">
                <span class="text-muted"><b>1</b>–<b>50</b> of <b>277</b></span>
                <div class="btn-group btn-group-sm">
                    <button type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-chevron-left"></span>
                    </button>
                    <button type="button" class="btn btn-default">
                        <span class="glyphicon glyphicon-chevron-right"></span>
                    </button>
                </div>
            </div>
        </div>
    </script>
}
